package city.spring.modules.medicalstation.drug.repository;

import city.spring.modules.medicalstation.drug.entity.DrugEntity;
import city.spring.modules.medicalstation.drug.vo.DrugVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 存储库：医护站药品信息
 *
 * @author 谢金婷
 * @date 2020-08-14 11:07:57
 */
@Repository
public interface DrugRepository extends BaseMapper<DrugEntity> {

    /**
     * 根据货架id 获取该货架下的药品信息
     * 根据这两个参数获取到唯一的药品？
     *
     * @param shelflevelId,code
     * @return
     */
    DrugEntity drugByShelfIdAndCode(String shelflevelId, String code);

    IPage<DrugVO> listPage(Page<? extends DrugEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends DrugEntity> wrapper);
}